package paper.domain;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Transient;

/**
 * <p>Class       : paper.domain.Subject
 * <p>Descdription: 论文课题
 * @author  顾力行-gulx@neusoft.com
 * @version 1.0.0
 */
@Entity
public class Topic extends BasePaper implements Cloneable{
	
	 //创建人
    private Long creatorId;
    @Column(name = "creator_id")
    public Long getCreatorId() {
        return creatorId;
    }
    public void setCreatorId(Long creatorId) {
        this.creatorId = creatorId;
    }
    
    //完成人：完成课题的用户
    private User finisher;
    @OneToOne(cascade = CascadeType.ALL)
    @JoinColumn(name="finisher_id")//关联主键
    public User getFinisher() {
        return finisher;
    }
    public void setFinisher(User finisher) {
        this.finisher = finisher;
    }
    
    @Transient
    public String getFinisherName() {
        return finisher==null?"":finisher.getName();
    }
}
